﻿using System;
using System.Collections.Generic;

namespace IOA.MES.DataAccess.VModel
{
    public class VObaInspectInfo : BaseVModel
    {
        private string _orderNo = string.Empty;
        private string _obeNo = string.Empty;
        private string _customerCode = string.Empty;
        private string _customerName = string.Empty;
        private string _innerOrderNo = string.Empty;

        ///<Summary>
        /// OBA检测单号
        ///</Summary>
        public string ObaNo
        {
            get { return string.IsNullOrWhiteSpace(_obeNo) ? string.Empty : _obeNo; }
            set { _obeNo = value; }
        }

        ///<Summary>
        /// 内部订单号
        ///</Summary>
        public string InnerOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_innerOrderNo) ? string.Empty : _innerOrderNo; }
            set { _innerOrderNo = value; }
        }

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 客户代码
        ///</Summary>
        public string CustomerCode
        {
            get { return string.IsNullOrWhiteSpace(_customerCode) ? string.Empty : _customerCode; }
            set { _customerCode = value; }
        }

        ///<Summary>
        /// 客户名称
        ///</Summary>
        public string CustomerName
        {
            get { return string.IsNullOrWhiteSpace(_customerName) ? string.Empty : _customerName; }
            set { _customerName = value; }
        }

        ///<Summary>
        /// 检测状态
        ///</Summary>
        public Enum.ObaStatus Status { get; set; }
        public string CNStatus { get { return !System.Enum.IsDefined(typeof(Enum.ObaStatus), Status) ? string.Empty : EnumConvert.ToDesc(Status); } }

        ///<Summary>
        /// FinishTime
        ///</Summary>
        public DateTime? FinishTime { get; set; }

        /// <summary>
        /// OBA检测包装
        /// </summary>
        public List<VObaPack> Packs { get; set; } = new List<VObaPack>();

        /// <summary>
        /// OBA过站列表
        /// </summary>
        public List<VObaSite> Sites { get; set; } = new List<VObaSite>();

        public string FinishTimeStr { get { return FinishTime?.ToString("yyyy-MM-dd HH:mm:ss") ?? string.Empty; } }
    }
}
